package org.site.eclipse;

import CarProject.*;

public class EclipseComponent
{
  protected static String nl;
  public static synchronized EclipseComponent create(String lineSeparator)
  {
    nl = lineSeparator;
    EclipseComponent result = new EclipseComponent();
    nl = null;
    return result;
  }

  public final String NL = nl == null ? (System.getProperties().getProperty("line.separator")) : nl;
  protected final String TEXT_1 = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><project-modules id=\"moduleCoreId\" project-version=\"1.5.0\">" + NL + "    <wb-module deploy-name=\"";
  protected final String TEXT_2 = "\">" + NL + "        <wb-resource deploy-path=\"/\" source-path=\"/WebContent\" tag=\"defaultRootSource\"/>" + NL + "        <wb-resource deploy-path=\"/WEB-INF/classes\" source-path=\"/src\"/>" + NL + "        <property name=\"context-root\" value=\"";
  protected final String TEXT_3 = "\"/>" + NL + "        <property name=\"java-output-path\" value=\"/";
  protected final String TEXT_4 = "/build/classes\"/>" + NL + "    </wb-module>" + NL + "</project-modules>";
  protected final String TEXT_5 = NL;

  public String generate(Object argument)
  {
    final StringBuffer stringBuffer = new StringBuffer();
     String name = ((SiteWeb) argument).getNom(); 
    stringBuffer.append(TEXT_1);
    stringBuffer.append(name);
    stringBuffer.append(TEXT_2);
    stringBuffer.append(name);
    stringBuffer.append(TEXT_3);
    stringBuffer.append(name);
    stringBuffer.append(TEXT_4);
    stringBuffer.append(TEXT_5);
    return stringBuffer.toString();
  }
}
